/******************************************************************************
// * 文件名：AiP33626.h
// *   作者：
// *   版本：
// *   介绍：
******************************************************************************/

/* 防止头文件重复包含 -------------------------------------------------------*/
#ifndef _AiP33626_H_
#define _AiP33626_H_

/* 头文件 -------------------------------------------------------------------*/
#include"PLT_HEADS.h"

/* 宏定义 -------------------------------------------------------------------*/
#define AiP33626_SCL           P3_4
#define AiP33626_SDA           P3_5
#define AiP33626_SCL_OUT()     P3TRIS |= 0x10
#define AiP33626_SDA_IN()      P3TRIS &= (~0x20)
#define AiP33626_SDA_OUT()     P3TRIS |= 0x20

#define Address_Write_00       0x78   //AiP33626写地址为0x78
#define Address_seg_num        16     //16段
#define Address_com_num        8      //8位

extern  uint8_t  Aip33626_Run;
extern  uint8_t  Aip33626_Rundata[Address_seg_num*Address_com_num];
extern  uint8_t  Aip33626_Pwmdata[Address_seg_num*Address_com_num];
/* 函数申明 -----------------------------------------------------------------*/
void IIC_HOLD(void);//总线拉高
void AiP33626_start(void);
void AiP33626_stop(void);
void AiP33626_ACK(void);
void AiP33626_write(unsigned char dat);
void AiP33626_init(void);
void AiP33626_Write_CMD(unsigned char cmd);
void AiP33626_I2C_Write_128(unsigned char dat);
void AiP33626_I2C_Write_Single(unsigned char GRIDn,unsigned char SEGn,unsigned char PWMn,unsigned char Lengethn);
void AiP33626_driver(void);
#endif

